Skip to content

Update docstrings - #448

Draft
mscroggs wants to merge 16 commits into
mainfrom
mscroggs/docs
Draft

mscroggs wants to merge 16 commits into
mainfrom
mscroggs/docs

Conversation

@mscroggs

@mscroggs mscroggs commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@mscroggs mscroggs added this to the v1.6 milestone Nov 18, 2026
@ASKabalan

Copy link
Copy Markdown
Collaborator

@mscroggs I think its a good idea to merge as soon as possible
as it does not touch critical code and it will suffer from many conflicts as we merge other PRs
what do you think

@mscroggs

Copy link
Copy Markdown
Collaborator Author

@mscroggs I think its a good idea to merge as soon as possible as it does not touch critical code and it will suffer from many conflicts as we merge other PRs what do you think

Agreed it would be sensible to merge this soon if someone can approve it

@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.98%. Comparing base (22692a7) to head (32728c8).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #448   +/-   ##
=======================================
  Coverage   96.98%   96.98%           
=======================================
  Files          36       36           
  Lines        3577     3577           
=======================================
  Hits         3469     3469           
  Misses        108      108           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…is causing test failure on Mac?"""

This reverts commit d2e0910.
@mscroggs

Copy link
Copy Markdown
Collaborator Author

I can't work out why these changes are causing a single test to fail on mac - I guess it must be related to the change in default values in this commit.

I tried reverting just the changes in that commit that looked like they might make a difference and it still failed. Reverting that full commit now to see if it is any of these

@mscroggs
mscroggs marked this pull request as draft November 27, 2026 10:33
@matt-graham

matt-graham commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

It looks like the tests are now passing here so I think the changes in #442 which pinned jax < 0.12.1 resolved these as @ASKabalan flagged this being necessary due the same tests failing there. Therefore it seems like changing some of the defaults to match what was stated in docstrings hasn't broken anything in tests. I would probably still err on the side of keeping the original default behaviour even though it conflicts with what documentation state. I'll add a commit therefore to change the defaults updated in 46033b2 back to their original values but then I think this should be good to go in (and it would be to get it merged soon as it touches a lot of files).

@matt-graham

Copy link
Copy Markdown
Collaborator

I forgot that that 46033b2 had been reverted so defaults are now back to what they were. I'll have a look through and see if any of the other changes in that commit to the actual docstrings should be retained.

@matt-graham matt-graham left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mscroggs this was a mammoth effort but it's also great to have this resolved. I've added a bunch of suggestions which restore some of changes around not having defaults separately stated in docstrings that were reverted. I've also suggested adding some further loosenings of type hints to indicate accepting None values (generally for nside) where I noticed them though these are not all strictly relevant to docstrings here. There was a few instances of types having slipped back in to docstrings which I think may have come in within merge.

@@ -205,36 +182,27 @@
nside: int = None,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nside: int = None,
nside: int | None = None,

L: int,
spin: int = 0,
sampling: str = "mw",
nside: int = None,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nside: int | None = None,

L: int,
spin: int = 0,
sampling: str = "mw",
nside: int = None,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nside: int | None = None,

spin: int = 0,
sampling: str = "mw",
method: str = "sov_fft_vectorized",
nside: int = None,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nside: int | None = None,

@@ -713,36 +645,28 @@
nside: int,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nside: int,
nside: int | None,

return sampling.lower() in ("mw", "mwss", "dh", "cc", "f2")


def ftm_shape(L: int, sampling: str = "mw", nside: int = None) -> tuple[int, int]:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def ftm_shape(L: int, sampling: str = "mw", nside: int | None = None) -> tuple[int, int]:

return 4 * nside


def nphi_ring(t: int, nside: int = None) -> int:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def nphi_ring(t: int, nside: int | None = None) -> int:

return np.exp(sign * 1j * np.arange(m_start_ind, L) * phi_offset)


def f_shape(L: int = None, sampling: str = "mw", nside: int = None) -> tuple[int]:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def f_shape(L: int | None = None, sampling: str = "mw", nside: int | None = None) -> tuple[int]:

ftm_in: Intermediate coefficients with indexing :math:`[\theta, m]`.
beta_in: Array of polar angles in radians.
L: Harmonic band-limit.
spin: Harmonic spin. Defaults to 0.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
spin: Harmonic spin. Defaults to 0.
spin: Harmonic spin.

sampling: Sampling scheme. Supported sampling schemes include
{"mwss", "dh", "gl", "healpix", "cc", "f2"}.
nside: HEALPix Nside resolution parameter. Only required
if sampling="healpix". Defaults to None.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if sampling="healpix". Defaults to None.
if sampling="healpix".

@matt-graham matt-graham left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mscroggs this was a mammoth effort but it's also great to have this resolved. I've added a bunch of suggestions which restore some of changes around not having defaults separately stated in docstrings that were reverted. I've also suggested adding some further loosenings of type hints to indicate accepting None values (generally for nside) where I noticed them though these are not all strictly relevant to docstrings here. There was a few instances of types having slipped back in to docstrings which I think may have come in within merge. None of this is a blocker to merging so approving now.

EDIT: GitHub errored when I first posted review but looks like it has ended up doubling up this comment.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove duplication of argument type information in docstrings

3 participants